#pragma once

#include <cstdint>

struct ID3D10Device;
struct ID3D10Buffer;

namespace DirectX
{
    struct XMFLOAT3;
}

namespace D3D10Utils
{
	struct Vertex;

	class Land
	{
	public:
		Land(const uint32_t rows, const uint32_t columns);
		~Land();

		void init(ID3D10Device * const device, const float cellSpacingX, const float cellSpacingZ);
		void draw();

	private:
		Vertex* createVertices(const float cellSpacingX, const float cellSpacingZ);
		uint32_t* createIndices();

        void initVertexBuffer(const Vertex * const vertices);
		void initIndexBuffer(const uint32_t * const indices);

		ID3D10Device *mDevice;
		ID3D10Buffer *mVertexBuffer;
		ID3D10Buffer *mIndexBuffer;

		const uint32_t mNumVertices;
		const uint32_t mNumFaces;

		const uint32_t mRows;
		const uint32_t mColumns;
	};
}
